<template>
  <div>
    <el-table ref="argumenttable" :data="priceRecordData" size="small" style="width: 100%;" border>
      <el-table-column prop="OperateContent" label="备注" width="60px" />
      <el-table-column prop="OperateDate" label="操作时间" width="100px" />
      <el-table-column prop label="原价格">
        <template slot-scope="scope">
          <div v-if="scope.row.PriceOld.length">
            <el-table :data="scope.row.PriceOld" size="small" :show-header="false">
              <el-table-column>
                <template slot-scope="scope">{{scope.row.SpecName}}</template>
              </el-table-column>
              <el-table-column>
                <template slot-scope="scope">供货价：{{scope.row.PriceSupply}}</template>
              </el-table-column>
              <el-table-column>
                <template slot-scope="scope">价格：{{scope.row.Price}}</template>
              </el-table-column>
            </el-table>
          </div>
          <span v-else>暂无数据</span>
        </template>
      </el-table-column>
      <el-table-column prop label="新价格">
        <template slot-scope="scope">
          <div v-if="scope.row.PriceNew.length">
            <el-table :data="scope.row.PriceNew" size="small" :show-header="false">
              <el-table-column>
                <template slot-scope="scope">{{scope.row.SpecName}}</template>
              </el-table-column>
              <el-table-column>
                <template slot-scope="scope">供货价：{{scope.row.PriceSupply}}</template>
              </el-table-column>
              <el-table-column>
                <template slot-scope="scope">价格：{{scope.row.Price}}</template>
              </el-table-column>
            </el-table>
          </div>
          <span v-else>暂无数据</span>
        </template>
      </el-table-column>
      <!--  <el-table-column prop="OperateDate" label="新价格">
        <template slot-scope="scope">
          <el-table :data="scope.row.PriceNew" size="small">
            <el-table-column prop="SpecName" label>规格价格名称：</el-table-column>
            <el-table-column prop="PriceSupply" label>供货价：</el-table-column>
            <el-table-column prop="Price" label>价格：</el-table-column>
          </el-table>
        </template>
      </el-table-column>-->
    </el-table>
  </div>
</template>

<script>
import { getPriceOpLog } from "@/api/platProduct/management";
export default {
  name: "priceRecord",
  data() {
    return {
      priceRecordData: null,
    };
  },
  props: {
    Id: {
      type: String,
      default: "",
      required: true,
    },
  },
  watch: {
    Id(newValue, oldValue) {
      if (newValue) {
        this.getList();
      }
    },
  },
  methods: {
    getList() {
      getPriceOpLog({
        Id: this.Id,
      })
        .then((res) => {
          if (res.status == 200) {
            if (res.data.code == 0) {
              this.priceRecordData = res.data.data;
            }
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
  },
  created() {},
  mounted() {
    this.getList();
  },
};
</script>

<style lang="scss" scoped>
</style>